/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Liste des modules pour les modules du bot ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Auteur: Thaeron
Projet: NewSyndrome
Licence: GPL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

#include "NewSyndrome.h"

module_list *add_element_module_list (module_list * ml, module * w)
{
	module_list *h;
	
	if (w == NULL)
		return (ml);
	
	h = (module_list *) malloc (sizeof (module_list));
	h->next = ml;
	
	h->auteur = strdup (w->auteur);
	h->name = strdup (w->name);
	h->version = strdup (w->version);
	h->description = strdup (w->description);
	h->ident = strdup (w->ident);
	
	return (h);
}


void free_module_list (module_list * ml)
{
	module_list *runner, *m;
	
	for (runner = ml; runner != NULL; runner = m)
	{
		m = runner->next;
		free (runner->auteur);
		free (runner->ident);
		free (runner->description);
		free (runner->name);
		free (runner->version);
		free (runner);
	}
}
